<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 不传参数时小括号可以省略不写 -->
        <button @click="add()">按钮1</button>
        <button @click="add">按钮1</button>
        <!-- 在定义事件时，写函数时省略了小括号，但是方法本身是需要一个参数的 -->
        <button @click="add">按钮1</button>
        <button @click="add">按钮1</button>
        <button @click="add">按钮1</button>
    </div>
</body>
<script src='../js/vue.js'></script>
<script>
    let app = new Vue({
        el: '#app',
        data: {
             msg:0
        },
        methods: {
            add(){
                console.log('add')
            },
           
        }
    })
</script>
</html>